package com.example.primarycalculator2;

import android.os.Parcel;
import android.os.Parcelable;
import org.litepal.LitePal;
import org.litepal.crud.LitePalSupport;
import org.litepal.parser.LitePalParser;

public class Problem extends LitePalSupport implements Parcelable {
    private String content;
    private String answer;
    private String realAnswer;
    private int picId;

//    protected Problem(Parcel in) {
//        content = in.readString();
//        answer = in.readString();
//        realAnswer = in.readString();
//        picId = in.readInt();
//    }

    public static final Creator<Problem> CREATOR = new Creator<Problem>() {

        @Override
        public Problem createFromParcel(Parcel in) {

            return new Problem(in.readString(),in.readString(),in.readString(),in.readInt());
        }

        @Override
        public Problem[] newArray(int size) {
            return new Problem[size];
        }
    };

    public String getRealAnswer() {
        return realAnswer;
    }

    public void setRealAnswer(String realAnswer) {
        this.realAnswer = realAnswer;
    }

    public int getPicId() {
        return picId;
    }

    public void setPicId(int picId) {
        this.picId = picId;
    }

    public Problem(String content, String answer){
        this.content=content;
        this.answer=answer;
    }
    public Problem(String content, String answer,String realAnswer){
        this.content=content;
        this.answer=answer;
        this.realAnswer=realAnswer;
    }

    public Problem(String content, String answer, String realAnswer, int picId) {
        this.content = content;
        this.answer = answer;
        this.realAnswer = realAnswer;
        this.picId = picId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(content);
        dest.writeString(answer);
        dest.writeString(realAnswer);
        dest.writeInt(picId);
    }
}
